create external table jms_dm.dm_privacy_waybill_sum_dt 
(
subordinate_agent_code string COMMENT '所属代理区code' ,
subordinate_agent_name string COMMENT '所属代理区' ,
first_franchisee_code string COMMENT '加盟商code' ,
first_franchisee_name string COMMENT '加盟商' ,
code  string COMMENT '网点编码' ,
name string COMMENT '网点名字' ,
waybill_cnt bigint COMMENT '到件、发件 运单总数' ,
gw_cnt bigint COMMENT '官网票数' ,
wx_cnt bigint COMMENT '微信票数' ,
vip_cnt bigint COMMENT 'VIP系统' ,
zypt_cnt bigint COMMENT '自有平台票数' ,
thd_cnt bigint COMMENT '桃花岛票数' ,
zjs_cnt bigint COMMENT '紫金山票数' ,
xyf_cnt bigint COMMENT '逍遥峰票数' ,
qxt_cnt bigint COMMENT '七星潭票数' ,
pt_cnt bigint COMMENT '平台总票数' ,
qt_cnt bigint COMMENT '其它票数' ,
sign_sum bigint COMMENT '签收量' ,
out_store_sum bigint COMMENT '出库量' ,
instore_sum bigint COMMENT '出库量',
date_time string comment'业务日期',
tpye2 int comment '类型'
 ,network_ewm_sum int comment '网点二维码'
 ,ywy_ewm_sum int comment '业务员二维码'
 ,zz_ewm_sum int comment '纸质二维码'
,zjs_bill_count  int comment'紫金山平台业务量'
    ,xyf_bill_count  int comment'逍遥峰平台业务量'
    ,qxt_bill_count  int comment'七星潭平台业务量'
    ,jdw_bill_count  int comment'极地湾平台业务量'
    ,wph_bill_count  int comment'唯品会平台业务量'
    ,sn_bill_count  int comment'苏宁平台业务量'
    ,thd_bill_count int comment '桃花岛业务量'
 )
comment '隐私面单汇总'
PARTITIONED BY ( dt string COMMENT '时间分区',type1 int COMMENT '类型 ')
stored as parquet
LOCATION '/dw/hive/jms_dm.db/external/dm_privacy_waybill_sum_dt'
TBLPROPERTIES (     'discover.partitions' = 'false',
 'parquet.column.index.access' = 'true'
 );

alter table jms_dm.dm_privacy_waybill_sum_dt add columns (
    waybill_sum                int comment '自有总业务量'--
  , ali_qxt_bill_count         int comment '淘系七星潭平台业务量'   --
  , ali_qxt_privacy_bill_count int comment '淘系七星潭隐私面单量量'     --
    )cascade ;